Dynomotion

Group: DynoMotion Message: 13435 From: andysontag Date: 7/3/2016
Subject: Closed Loop Stepper Tuning Help Needed

Hi All,


After using my 4' x 8' Router for a while I figured it might be a good idea to tune the motors. After running a few test moves in the Step Response window I deduced something is definitely not setup correctly. I've attached some screen shots and a copy of my init file. 


Not terribly long ago I switched my encoders to a higher resolution encoder that is suppose to work better with stepper motors (AMT11 Series) and instead of 2048 the resolution is now 4096. I suspect the root of the issue has something to do with the change even though I thought I had correctly accounted for the change in the init file.


Does anyone have any idea why my plots are so strange? 


Andy

  @@attachment@@
Group: DynoMotion Message: 13436 From: Tom Kerekes Date: 7/3/2016
Subject: Re: Closed Loop Stepper Tuning Help Needed [7 Attachments]
Hi Andy,

It looks like your InputGain0 is 2X too large.

Regards
TK

On Jul 3, 2016, at 2:56 PM, andysontag@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:

 

Hi All,


After using my 4' x 8' Router for a while I figured it might be a good idea to tune the motors. After running a few test moves in the Step Response window I deduced something is definitely not setup correctly. I've attached some screen shots and a copy of my init file. 


Not terribly long ago I switched my encoders to a higher resolution encoder that is suppose to work better with stepper motors (AMT11 Series) and instead of 2048 the resolution is now 4096. I suspect the root of the issue has something to do with the change even though I thought I had correctly accounted for the change in the init file.


Does anyone have any idea why my plots are so strange? 


Andy

Group: DynoMotion Message: 13437 From: andysontag Date: 7/3/2016
Subject: Re: Closed Loop Stepper Tuning Help Needed
Hi Tom,

It appears my init file settings aren't being downloaded to the Kflop when I run the init file or click the download button inside the C Program screen. I updated the input gain via the configuration screen, downloaded the new setting to the kflop, and ran the step response test again. I've attached the resulting plots. 

There is still a gap between command and output but much better than before. Am I missing something obvious or should I look through the init code again to see if there is a mistake causing the data not to sync up between the init file and the kflop?

Andy
  @@attachment@@
Group: DynoMotion Message: 13445 From: andysontag Date: 7/4/2016
Subject: Re: Closed Loop Stepper Tuning Help Needed
Still haven't figured out why the init file settings aren't being used but in any case I have managed to dial the axis in a bit. In the config and flash screen the channel wasn't set to CL Micro output as it should have been. Once this was set I could start making progress with tuning. I've attached a couple screen shots showing where I ended up at. 

Feed Forward and dead band are next. 

Andy
  @@attachment@@
Group: DynoMotion Message: 13465 From: Tom Kerekes Date: 7/5/2016
Subject: Re: Closed Loop Stepper Tuning Help Needed [5 Attachments]

Hi Andy,

When you push "Download" or "Move" in the KMotion.exe application the axis screen settings will be downloaded to KFLOP overwriting anything that might have been set by your Init program.

Another thing to understand is changing the Init program file won't necessarily change or set anything in KFLOP. It is the act of downloading and executing the program that changes the settings in KFLOP.

If you are using the KMotion Step Response Screen make sure all your Screen Settings are set to what you want.  There are various ways to make sure the Screen settings match your Init Program.  #1 you can import the settings to the screens.  #2 you can compile/execute the Init Program then upload the settings to the KMotion Screens.  You might watch this Video (Adobe Flash is required):

http://dynomotion.com/Help/FlashHelp/Parameters/index.html

Regarding your plots.  It seems you are off about 20 for a move of 1000.  You might be interpreting the settings as 1024 vs 1000 (or any multiple such as 4000 vs 4096) or vice versa that would cause an error of 24.  A true mechanical error of 4 counts might explain the difference.

HTH

Regards

TK


On 7/3/2016 5:18 PM, andysontag@... [DynoMotion] wrote:
 

Hi Tom,


It appears my init file settings aren't being downloaded to the Kflop when I run the init file or click the download button inside the C Program screen. I updated the input gain via the configuration screen, downloaded the new setting to the kflop, and ran the step response test again. I've attached the resulting plots. 

There is still a gap between command and output but much better than before. Am I missing something obvious or should I look through the init code again to see if there is a mistake causing the data not to sync up between the init file and the kflop?

Andy

Group: DynoMotion Message: 13466 From: Tom Kerekes Date: 7/5/2016
Subject: Re: Closed Loop Stepper Tuning Help Needed [3 Attachments]

Hi Andy,

Seems really good to me.  The Servo Output is correcting for about ~10 units of error that you would normally have open loop and the residual error is only ~ 0.15 units.

But I'm not sure what your units are.

Regards

TK


On 7/4/2016 11:18 AM, andysontag@... [DynoMotion] wrote:
 

Still haven't figured out why the init file settings aren't being used but in any case I have managed to dial the axis in a bit. In the config and flash screen the channel wasn't set to CL Micro output as it should have been. Once this was set I could start making progress with tuning. I've attached a couple screen shots showing where I ended up at. 


Feed Forward and dead band are next. 

Andy

Group: DynoMotion Message: 13485 From: andysontag Date: 7/6/2016
Subject: Re: Closed Loop Stepper Tuning Help Needed
Hi Tom,

I think my issue with the init file not updating the Kflop has something to do with the motors being engaged. When they are, the init file won't update the motor parameters. When starting up the kflop fresh, the init file will correctly update the motor parameters. It appears extremely important to make sure your Step response and Config & Flash screen settings are correct before trying to tune an axis within the Step Response screen.

Some other points I've learned regarding tuning standard 1.8 degree stepper motors with a Kflop/SnapAmp combo. Please correct me if I have misunderstood anything. 
  • Lead Compensation is irrelevant. SnapAmps won't use this parameter.
  • For CL Micro Mode, always set the gain to 50 / (4 * encoder PPR). If you read this page it will lead you to try using a different gain value which won't work with CL Micro Mode.
  • In CL Micro Mode, the Microstepper Amplitude setting is for setting the stepper Amp/Current rating. I believe the value is suppose to be 29.2 per Amp. For a 7A stepper the value should be 204.4.
  • Tom recommends keeping the Inv Dist Per Cycle setting at 1. This will mean all of your Step Response values will be in Cycles. 
  • In Trajectory Planner, to convert Inches per Second to Cycles Per Second, just multiply your Inches per Second value by your Counts per Inch value (which is actually Cycles per Inch). For some reason it took me a while to get my head around this one. 
I've attached some updated plots which are using corrected values. Would there be any value in experimenting with Feed Forward with a CL Micro setup? If so how would you recommend doing so? Same question for dead band.

Andy


---In DynoMotion@yahoogroups.com, <tk@...> wrote :

Hi Andy,

Seems really good to me.  The Servo Output is correcting for about ~10 units of error that you would normally have open loop and the residual error is only ~ 0.15 units.

But I'm not sure what your units are.

Regards

TK


On 7/4/2016 11:18 AM, andysontag@... [DynoMotion] wrote:
 

Still haven't figured out why the init file settings aren't being used but in any case I have managed to dial the axis in a bit. In the config and flash screen the channel wasn't set to CL Micro output as it should have been. Once this was set I could start making progress with tuning. I've attached a couple screen shots showing where I ended up at. 


Feed Forward and dead band are next. 

Andy

  @@attachment@@
Group: DynoMotion Message: 13486 From: Tom Kerekes Date: 7/6/2016
Subject: Re: Closed Loop Stepper Tuning Help Needed [6 Attachments]

Hi Andy,

I believe those bullet points are all correct.

I forgot you are using those AMT capacitor encoders.  I dislike those because they have so much position jitter/noise.  Search for "AMT Noise" and you are likely to find many posts.  Here a User plotted the Encoder output:

https://groups.yahoo.com/neo/groups/DynoMotion/conversations/messages/4103

Your position error plot shows about +/- 0.08 of noise.  I suspect it is mostly all encoder noise (more than 200 counts?).  The encoder noise frequency is usually so high that the servo response just sees the average so it works fairly well.  But it makes it hard to know what is really going on.

But at your Z resolution of 254 cycles/inch that comes out to only +/- 0.00031 inches.  So I would expect that is good enough.

I see there is a probably gravity effecting the Z axis as the servo output is biased.  But that is fine and exactly the purpose of the feedback.

Your errors are small enough and is mostly all noise so I don't see any need for FF.  If Feedback can do the job then it is always preferable to FF because FF is open loop.  You might use FF to get excellent results but if anything changes - friction, cutting forces, load, etc the result is likely to be nearly as bad as without FF. 

Deadband is normally used to solve annoying one or several counts of servo dither when attempting to remain still. 

HTH

Regards

TK



On 7/6/2016 3:13 PM, andysontag@... [DynoMotion] wrote:
 

Hi Tom,


I think my issue with the init file not updating the Kflop has something to do with the motors being engaged. When they are, the init file won't update the motor parameters. When starting up the kflop fresh, the init file will correctly update the motor parameters. It appears extremely important to make sure your Step response and Config & Flash screen settings are correct before trying to tune an axis within the Step Response screen.

Some other points I've learned regarding tuning standard 1.8 degree stepper motors with a Kflop/SnapAmp combo. Please correct me if I have misunderstood anything. 
  • Lead Compensation is irrelevant. SnapAmps won't use this parameter.
  • For CL Micro Mode, always set the gain to 50 / (4 * encoder PPR). If you read this page it will lead you to try using a different gain value which won't work with CL Micro Mode.
  • In CL Micro Mode, the Microstepper Amplitude setting is for setting the stepper Amp/Current rating. I believe the value is suppose to be 29.2 per Amp. For a 7A stepper the value should be 204.4.
  • Tom recommends keeping the Inv Dist Per Cycle setting at 1. This will mean all of your Step Response values will be in Cycles. 
  • In Trajectory Planner, to convert Inches per Second to Cycles Per Second, just multiply your Inches per Second value by your Counts per Inch value (which is actually Cycles per Inch). For some reason it took me a while to get my head around this one. 
I've attached some updated plots which are using corrected values. Would there be any value in experimenting with Feed Forward with a CL Micro setup? If so how would you recommend doing so? Same question for dead band.

Andy


---In DynoMotion@yahoogroups.com, <tk@...> wrote :

Hi Andy,

Seems really good to me.  The Servo Output is correcting for about ~10 units of error that you would normally have open loop and the residual error is only ~ 0.15 units.

But I'm not sure what your units are.

Regards

TK


On 7/4/2016 11:18 AM, andysontag@... [DynoMotion] wrote:
 

Still haven't figured out why the init file settings aren't being used but in any case I have managed to dial the axis in a bit. In the config and flash screen the channel wasn't set to CL Micro output as it should have been. Once this was set I could start making progress with tuning. I've attached a couple screen shots showing where I ended up at. 


Feed Forward and dead band are next. 

Andy


Group: DynoMotion Message: 13513 From: Andy Sontag Date: 7/8/2016
Subject: Re: Closed Loop Stepper Tuning Help Needed
Hi Tom,

Yes, the AMT11 encoders have some drawbacks but I think we have them working sufficiently well. If I were to do it again, I would have gone with glass scales for feedback.

The number 2 axis is actually the Y so +/- .08 cycles would be closer to .0016" of error, or around 26 encoder counts. Certainly sufficient and well beyond the physical accuracy of the hardware.

Thanks for the help. I think you're right, it doesn't sound like FF or Deadband will help at all. I'm pretty confident the machine is performing as well as it is capable.

Andy

On Wed, Jul 6, 2016 at 4:26 PM, Tom Kerekes tk@... [DynoMotion] <DynoMotion@yahoogroups.com> wrote:
 

Hi Andy,

I believe those bullet points are all correct.

I forgot you are using those AMT capacitor encoders.  I dislike those because they have so much position jitter/noise.  Search for "AMT Noise" and you are likely to find many posts.  Here a User plotted the Encoder output:

https://groups.yahoo.com/neo/groups/DynoMotion/conversations/messages/4103

Your position error plot shows about +/- 0.08 of noise.  I suspect it is mostly all encoder noise (more than 200 counts?).  The encoder noise frequency is usually so high that the servo response just sees the average so it works fairly well.  But it makes it hard to know what is really going on.

But at your Z resolution of 254 cycles/inch that comes out to only +/- 0.00031 inches.  So I would expect that is good enough.

I see there is a probably gravity effecting the Z axis as the servo output is biased.  But that is fine and exactly the purpose of the feedback.

Your errors are small enough and is mostly all noise so I don't see any need for FF.  If Feedback can do the job then it is always preferable to FF because FF is open loop.  You might use FF to get excellent results but if anything changes - friction, cutting forces, load, etc the result is likely to be nearly as bad as without FF. 

Deadband is normally used to solve annoying one or several counts of servo dither when attempting to remain still. 

HTH

Regards

TK



On 7/6/2016 3:13 PM, andysontag@... [DynoMotion] wrote:
 

Hi Tom,


I think my issue with the init file not updating the Kflop has something to do with the motors being engaged. When they are, the init file won't update the motor parameters. When starting up the kflop fresh, the init file will correctly update the motor parameters. It appears extremely important to make sure your Step response and Config & Flash screen settings are correct before trying to tune an axis within the Step Response screen.

Some other points I've learned regarding tuning standard 1.8 degree stepper motors with a Kflop/SnapAmp combo. Please correct me if I have misunderstood anything. 
  • Lead Compensation is irrelevant. SnapAmps won't use this parameter.
  • For CL Micro Mode, always set the gain to 50 / (4 * encoder PPR). If you read this page it will lead you to try using a different gain value which won't work with CL Micro Mode.
  • In CL Micro Mode, the Microstepper Amplitude setting is for setting the stepper Amp/Current rating. I believe the value is suppose to be 29.2 per Amp. For a 7A stepper the value should be 204.4.
  • Tom recommends keeping the Inv Dist Per Cycle setting at 1. This will mean all of your Step Response values will be in Cycles. 
  • In Trajectory Planner, to convert Inches per Second to Cycles Per Second, just multiply your Inches per Second value by your Counts per Inch value (which is actually Cycles per Inch). For some reason it took me a while to get my head around this one. 
I've attached some updated plots which are using corrected values. Would there be any value in experimenting with Feed Forward with a CL Micro setup? If so how would you recommend doing so? Same question for dead band.

Andy


---In DynoMotion@yahoogroups.com, <tk@...> wrote :

Hi Andy,

Seems really good to me.  The Servo Output is correcting for about ~10 units of error that you would normally have open loop and the residual error is only ~ 0.15 units.

But I'm not sure what your units are.

Regards

TK


On 7/4/2016 11:18 AM, andysontag@... [DynoMotion] wrote:
 

Still haven't figured out why the init file settings aren't being used but in any case I have managed to dial the axis in a bit. In the config and flash screen the channel wasn't set to CL Micro output as it should have been. Once this was set I could start making progress with tuning. I've attached a couple screen shots showing where I ended up at. 


Feed Forward and dead band are next. 

Andy